/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.sisportaria.bean;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author lac
 */
@Entity
@Table(name = "DESTINO")
@NamedQueries({@NamedQuery(name = "Destino.findAll", query = "SELECT d FROM Destino d"), @NamedQuery(name = "Destino.findByDtncodg", query = "SELECT d FROM Destino d WHERE d.dtncodg = :dtncodg"), @NamedQuery(name = "Destino.findByDtcdesc", query = "SELECT d FROM Destino d WHERE d.dtcdesc = :dtcdesc")})
public class Destino implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "DTNCODG")
    private Integer dtncodg;
    @Column(name = "DTCDESC")
    private String dtcdesc;

    public Destino() {
    }

    public Destino(Integer dtncodg) {
        this.dtncodg = dtncodg;
    }

    public Integer getDtncodg() {
        return dtncodg;
    }

    public void setDtncodg(Integer dtncodg) {
        Integer oldDtncodg = this.dtncodg;
        this.dtncodg = dtncodg;
        changeSupport.firePropertyChange("dtncodg", oldDtncodg, dtncodg);
    }

    public String getDtcdesc() {
        return dtcdesc;
    }

    public void setDtcdesc(String dtcdesc) {
        String oldDtcdesc = this.dtcdesc;
        this.dtcdesc = dtcdesc;
        changeSupport.firePropertyChange("dtcdesc", oldDtcdesc, dtcdesc);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dtncodg != null ? dtncodg.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Destino)) {
            return false;
        }
        Destino other = (Destino) object;
        if ((this.dtncodg == null && other.dtncodg != null) || (this.dtncodg != null && !this.dtncodg.equals(other.dtncodg))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.sisportaria.view.Destino[dtncodg=" + dtncodg + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
